import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: 'id',
    dataIndex: 'id',
    width: 120,
  },
  {
    title: 'UUID',
    dataIndex: 'UUID',
    width: 120,
  },
  {
    title: 'md5',
    dataIndex: 'md5',
    width: 120,
  },
  {
    title: '文件仓库Id',
    dataIndex: 'fileStorageId',
    width: 120,
  },
  {
    title: '父文件夹Id',
    dataIndex: 'parentFolderId',
    width: 120,
  },
  {
    title: '文件名字',
    dataIndex: 'name',
    width: 120,
  },
  {
    title: '相对路径',
    dataIndex: 'path',
    width: 120,
  },
  {
    title: '文件大小',
    dataIndex: 'size',
    width: 120,
  },
  {
    title: '文件后缀',
    dataIndex: 'suffix',
    width: 120,
  },
  {
    title: '下载次数',
    dataIndex: 'downloadCount',
    width: 120,
  },
  {
    title: '文件状态',
    dataIndex: 'state',
    width: 120,
  },
  {
    title: '上传时间',
    dataIndex: 'gmtCreated',
    width: 120,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'id',
    label: '文件id',
    component: 'Input',
    colProps: { span: 5 },
  },
  {
    field: 'UUID',
    label: 'UUID',
    component: 'Input',
    colProps: { span: 5 },
  },
  {
    field: 'fileStorageId',
    label: '文件仓库id',
    component: 'Input',
    colProps: { span: 5 },
  },
  {
    field: 'name',
    label: '文件名字',
    component: 'Input',
    colProps: { span: 5 },
  },
  {
    field: 'type',
    label: '文件类型',
    component: 'Input',
    colProps: { span: 5 },
  },
  {
    field: 'suffix',
    label: '文件后缀',
    component: 'Input',
    colProps: { span: 5 },
  },
  {
    field: 'state',
    label: '文件状态',
    component: 'Input',
    colProps: { span: 5 },
  },
];

export const UploadFileFormSchema: FormSchema[] = [
  {
    label: 'id',
    field: 'id',
    component: 'Input',
    required: false,
    ifShow: true
  },
  {
    field: 'name',
    label: '文件名',
    component: 'Input',
    required: true,
  },
];
